import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-10
 * Time: 15:59
 */

class Person {
    private String name = "null";
    private boolean gender = false;
    private int age = 0;
    private int id;
    static int count = 0;
    Person() {
        System.out.println("This is initialization block, id is "+this.count);
        System.out.println("This is constructor");
        id=count;
    }

    Person(String name, int age, boolean gender) {
        id=count++;
        this.age = age;
        this.gender = gender;
        this.name = name;
        System.out.println("This is initialization block, id is "+this.id);
    }

    public static int getCount() {
        return count;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public boolean getGender() {
        return gender;
    }

    static {
        System.out.println("This is static initialization block");
    }

    public String toString() {
        return "Person [name=" + name + ", age=" + age + ", gender=" + gender + ", id=" + id + "]";
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Person arr[] = new Person[n];
        for (int i = 0; i < n; i++) {
            String name = sc.next();
            int age = sc.nextInt();
            boolean gender = sc.nextBoolean();
            arr[i] = new Person(name, age, gender);

        }
        for (int i = n-1; i >= 0 ; i--) {
            System.out.println(arr[i].toString());;
        }
        Person b = new Person();
        System.out.println(b.getName()+","+b.getAge()+","+b.getGender()+","+b.getCount());
        System.out.println(b);
        sc.close();
    }
}
